home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / arith2.com / MODEL_H.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1989-02-27  |  2.3 KB  |  69 lines

  1. UNIT model_h;
  2.  
  3.         { ------------------------------------------------------------------
  4.  
  5.           This program and its associates implement in Turbo Pascal v5
  6.           the aritmetic encoding/decoding algorithms presented in the papers
  7.  
  8.           "Arithmetic Coding for Data Compression"
  9.  
  10.                    by Ian     H. Witten
  11.                       Radford M. Neal
  12.                       John    G. Cleary
  13.  
  14.           pp 520 - 540 of June 1987 Communications of the ACM
  15.  
  16.           and
  17.  
  18.           "An Adaptive Dependency Source Model For Data Compression"
  19.  
  20.                    by David M. Abrahamson
  21.  
  22.           pp 77 - 83 of January 1989 Communications of the ACM
  23.  
  24.           ------------------------------------------------------------------
  25.  
  26.           Implemented by Ken Westerback : CompuServe 73547,3520
  27.  
  28.           version 1.0 released 89/02/19
  29.           version 2.0 released 89/02/27
  30.  
  31.           These programs, units and associated documentation are released
  32.           into the public domain to be used and abused as your whims
  33.           dictate.
  34.  
  35.           Feel free to distribute/incorporate/improve as desired.
  36.  
  37.           >>>>> Use at your own risk! <<<<<
  38.  
  39.           Comments and suggestions welcome via CompuServe.
  40.  
  41.           ------------------------------------------------------------------
  42.         }
  43.  
  44. INTERFACE
  45.  
  46. { characters are in the range of 0..255 ( one byte ) while symbols are in }
  47. { the range 1..257, with a symbol of 0 being a dummy value used to store  }
  48. { sentinal values in some arrays                                          }
  49.  
  50. const no_of_chars     = 256;             { number of different characters  }
  51.       eof_symbol      = no_of_chars + 1; { EOF symbol                      }
  52.       no_of_symbols   = no_of_chars + 1; { total number of symbols         }
  53.       max_frequency   = 16383;           { maximum allowed frequency count }
  54.                                          {    = 2**14 -1                   }
  55.  
  56.       fix_model_id                 = 'f';
  57.       adaptive_model_id            = 'a';
  58.       adaptive_dependency_model_id = 'd';
  59.  
  60.       valid_models = [ 'f', 'a', 'd' ];
  61.  
  62. { cumulative & non-cumulative symbol frequencies }
  63.  
  64. var cum_freq :  array [ 0..no_of_symbols ] of word;
  65.     freq     :  array [ 0..no_of_symbols ] of word;
  66.  
  67. IMPLEMENTATION
  68.  
  69. END. { model 'header' }